declare
fun {Spawn P}
Id Ok in
   thread
      Id={Thread.this}
      {Wait Ok}
      {P}
   end
   {Thread.suspend Id}
   Ok=unit
   Id
end

proc {Resume Id}
Ok Me={Thread.this} in
   thread
      {Thread.suspend Me}
      Ok=unit
      {Thread.resume Id}
   end
   {Wait Ok}
end
